package com.qf.controller;

import com.qf.pojo.User;
import com.qf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 千锋健哥
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private UserService userService;

    @Resource(name = "user1")
    private User user;

    @Value("${alibaba.username}")
    private String username;
    @Value("${alibaba.password}")
    private String password;

    @RequestMapping("/t1")
    public String test1() {

        return "欢迎第一次使用springboot, 很简单!!!" + user + username + password;
    }

    @RequestMapping("/t2")
    public List<User> findAll() {
        List<User> list = userService.findUserAll();
        return list;
    }


//    @RequestMapping("/t3")
//    public PageInfo<User> findUserByPage(int pageNo) {
//        PageInfo<User> page = userService.findUserByPage(pageNo);
//        return page;
//    }
}
